package edu.mis.modules.orderDetailRoom;

import com.jfinal.plugin.activerecord.Record;
import edu.mis.model.OrderDetailRoom;

import java.util.List;


public class OrderDetailRoomService {
    public boolean addOrderDetailRoom(OrderDetailRoom orderDetailRoom){
        return orderDetailRoom.save();

    }
    public boolean updateOrderDetailRoom(OrderDetailRoom orderDetailRoom){
        return orderDetailRoom.update();
    }
    public boolean deleteOrderDetailRoomById(int id) {
        return OrderDetailRoom.dao.deleteById(id);
    }
    /**
     * 根据ID得到该订单的信息
     * @param id
     * @return
     */
    public OrderDetailRoom findOrderDetailRoomById(int id) {
        return OrderDetailRoom.dao.findById(id);
    }


    public List<Record> findAllRecord(){
        return OrderDetailRoom.dao.findAllRecord();
    }
    public List<Record> findRoomByOrderListId(Integer orderListId){
        return OrderDetailRoom.dao.findRoomByOrderListId(orderListId);
    }

    /**
     * 查询所有订单明细
     * @return
     */
    public List<OrderDetailRoom> findAll(){
        return OrderDetailRoom.dao.findAll();
    }

}
